<template>
  <div style="height: 100%;">
    <div class="head">
      <a @click="prev" id="btn_back_chanping" class="return"></a>添加资料
    </div>
    <div class="weui-tab weui-fixed weui-tab_apply"  style="padding-top: 45px;">
      <div class="weui-tab__bd weui_paddingdown">
        <div id="tab1" class="weui-tab__bd-item weui-tab__bd-item--active">
          <form id="applyInfoForm">
            <div class="weui-cell">
              <div class="weui-cell__bd">
                <div class="weui-uploader">
                  <div class="weui-uploader__hd">
                    <p class="weui-uploader__title">人民银行个人征信报告</p>
                    <a class="weui-btn weui-btn_primary" @click="delCreditReportFile">重新上传</a>
                    <div class="weui-uploader__info creditReportFile_js_counter">0/5</div>
                  </div>
                  <div class="weui-uploader__bd">
                    <ul class="creditReportFile_weui_uploader_files" id="creditReportFileDel">
                    </ul>
                    <div class="weui-uploader__input-box">
                      <input id="creditReportFile" name="creditReportFile" value="" type="hidden" />
                      <input id="creditReportFile_uploaderInput" class="weui-uploader__input" type="file" accept="image/*" multiple="1" @change="addCreditReportFile">
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <div class="weui-cell">
              <div class="weui-cell__bd">
                <div class="weui-uploader">
                  <div class="weui-uploader__hd">
                    <p class="weui-uploader__title">自有房产证</p>
                    <a class="weui-btn weui-btn_primary" @click="delHouseTypeFile">重新上传</a>
                    <div class="weui-uploader__info houseTypeFile_js_counter">0/5</div>
                  </div>
                  <div class="weui-uploader__bd">
                    <ul class="houseTypeFile_weui_uploader_files" id="houseTypeFileDel">
                    </ul>
                    <div class="weui-uploader__input-box">
                      <input id="houseTypeFile" name="houseTypeFile" value="" type="hidden" />
                      <input id="houseTypeFile_uploaderInput" class="weui-uploader__input" type="file" accept="image/*" multiple="1" @change="addHouseTypeFile">
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <div class="weui-cell ">
              <div class="weui-cell__bd">
                <div class="weui-uploader">
                  <div class="weui-uploader__hd">
                    <p class="weui-uploader__title">车辆行驶证</p>
                    <a class="weui-btn weui-btn_primary" @click="delCarTypeFile">重新上传</a>
                    <div class="weui-uploader__info carTypeFile_js_counter">0/5</div>
                  </div>
                  <div class="weui-uploader__bd">
                    <ul class="carTypeFile_weui_uploader_files" id="carTypeFileDel">
                    </ul>
                    <div class="weui-uploader__input-box">
                      <input id="carTypeFile" name="carTypeFile" value="" type="hidden" />
                      <input id="carTypeFile_uploaderInput" class="weui-uploader__input" type="file" accept="image/*" multiple="1" @change="addCarTypeFile">
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <div v-if="marriage === 1">
              <div class="weui-cell ">
                <div class="weui-cell__bd">
                  <div class="weui-uploader">
                    <div class="weui-uploader__hd">
                      <p class="weui-uploader__title">经营流水</p>
                      <a class="weui-btn weui-btn_primary" @click="delRunningWaterFile">重新上传</a>
                      <div class="weui-uploader__info runningWaterFile_js_counter">0/5</div>
                    </div>
                    <div class="weui-uploader__bd">
                      <ul class="runningWaterFile_weui_uploader_files" id="runningWaterFileDel">
                      </ul>
                      <div class="weui-uploader__input-box">
                        <input id="runningWaterFile" name="runningWaterFile" value="" type="hidden" />
                        <input id="runningWaterFile_uploaderInput" class="weui-uploader__input" type="file" accept="image/*" multiple="1" @change="addRunningWaterFile">
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <div class="weui-cell ">
                <div class="weui-cell__bd">
                  <div class="weui-uploader">
                    <div class="weui-uploader__hd">
                      <p class="weui-uploader__title">企业征信</p>
                      <a class="weui-btn weui-btn_primary" @click="delEnterpriseCreditFile">重新上传</a>
                      <div class="weui-uploader__info enterpriseCreditFile_js_counter">0/5</div>
                    </div>
                    <div class="weui-uploader__bd">
                      <ul class="enterpriseCreditFile_weui_uploader_files" id="enterpriseCreditFileDel">
                      </ul>
                      <div class="weui-uploader__input-box">
                        <input id="enterpriseCreditFile" name="enterpriseCreditFile" value="" type="hidden" />
                        <input id="enterpriseCreditFile_uploaderInput" class="weui-uploader__input" type="file" accept="image/*" multiple="1" @change="addEnterpriseCreditFile">
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <div v-if="marriage === 2">
              <div class="weui-cell">
                <div class="weui-cell__bd">
                  <div class="weui-uploader">
                    <div class="weui-uploader__hd">
                      <p class="weui-uploader__title">名片/工牌</p>
                      <a class="weui-btn weui-btn_primary" @click="delWorkCardFile">重新上传</a>
                      <div class="weui-uploader__info workCardFile_js_counter">0/5</div>
                    </div>
                    <div class="weui-uploader__bd">
                      <ul class="workCardFile_weui_uploader_files" id="workCardFileDel">
                      </ul>
                      <div class="weui-uploader__input-box">
                        <input id="workCardFile" name="workCardFile" value="" type="hidden" />
                        <input id="workCardFile_uploaderInput" class="weui-uploader__input" type="file" accept="image/*" multiple="1" @change="addWorkCardFile">
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <div class="weui-cell">
                <div class="weui-cell__bd">
                  <div class="weui-uploader">
                    <div class="weui-uploader__hd">
                      <p class="weui-uploader__title">工资收入流水</p>
                      <a class="weui-btn weui-btn_primary" @click="delWageWaterFile">重新上传</a>
                      <div class="weui-uploader__info wageWaterFile_js_counter">0/5</div>
                    </div>
                    <div class="weui-uploader__bd">
                      <ul class="wageWaterFile_weui_uploader_files" id="wageWaterFileDel">
                      </ul>
                      <div class="weui-uploader__input-box">
                        <input id="wageWaterFile" name="wageWaterFile" value="" type="hidden" />
                        <input id="wageWaterFile_uploaderInput" class="weui-uploader__input" type="file" accept="image/*" multiple="1" @change="addWageWaterFile">
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <div class="weui-cell">
                <div class="weui-cell__bd">
                  <div class="weui-uploader">
                    <div class="weui-uploader__hd">
                      <p class="weui-uploader__title">个税证明</p>
                      <a class="weui-btn weui-btn_primary" @click="delIndividualTaxProofFile">重新上传</a>
                      <div class="weui-uploader__info individualTaxProofFile_js_counter">0/5</div>
                    </div>
                    <div class="weui-uploader__bd">
                      <ul class="individualTaxProofFile_weui_uploader_files" id="individualTaxProofFileDel">
                      </ul>
                      <div class="weui-uploader__input-box">
                        <input id="individualTaxProofFile" name="individualTaxProofFile" value="" type="hidden" />
                        <input id="individualTaxProofFile_uploaderInput" class="weui-uploader__input" type="file" accept="image/*" multiple="1" @change="addIndividualTaxProofFile">
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>
    <div class="weui-flex weui-fixed-btm p10 weui-tab__bd-item" id="applyBtnDiv">
      <a @click="applyInfoBtn" class="weui-btn weui-btn_primary_down weui-btn_shenqing">下一步</a>
    </div>
  </div>
</template>

<script>
import $ from 'jquery'
window.jQuery = $
window.$ = $
export default {
  data () {
    return {
      marriage: 2
    }
  },
  methods: {
    prev: function () {
      this.$router.go(-1)
    },
    applyInfoBtn: function () {
      var data = $('#applyInfoForm').serialize()
      console.log('添加资料：' + data)
      this.$router.push({ path: '/LoanAuth' })
    },
    addCreditReportFile (event) {
      this.util.hzdjUploading(event, 'creditReportFile', 5)
    },
    delCreditReportFile (event) {
      this.util.del(event, 'creditReportFile', 5)
    },
    addHouseTypeFile (event) {
      this.util.hzdjUploading(event, 'houseTypeFile', 5)
    },
    delHouseTypeFile (event) {
      this.util.del(event, 'houseTypeFile', 5)
    },
    addCarTypeFile (event) {
      this.util.hzdjUploading(event, 'carTypeFile', 5)
    },
    delCarTypeFile (event) {
      this.util.del(event, 'carTypeFile', 5)
    },
    addRunningWaterFile (event) {
      this.util.hzdjUploading(event, 'runningWaterFile', 5)
    },
    delRunningWaterFile (event) {
      this.util.del(event, 'runningWaterFile', 5)
    },
    addEnterpriseCreditFile (event) {
      this.util.hzdjUploading(event, 'enterpriseCreditFile', 5)
    },
    delEnterpriseCreditFile (event) {
      this.util.del(event, 'enterpriseCreditFile', 5)
    },
    addWorkCardFile (event) {
      this.util.hzdjUploading(event, 'workCardFile', 5)
    },
    delWorkCardFile (event) {
      this.util.del(event, 'workCardFile', 5)
    },
    addWageWaterFile (event) {
      this.util.hzdjUploading(event, 'wageWaterFile', 5)
    },
    delWageWaterFile (event) {
      this.util.del(event, 'wageWaterFile', 5)
    },
    addIndividualTaxProofFile (event) {
      this.util.hzdjUploading(event, 'individualTaxProofFile', 5)
    },
    delIndividualTaxProofFile (event) {
      this.util.del(event, 'individualTaxProofFile', 5)
    }
  },
  mounted () {
    $.toast('请根据您的实际情况选择并上传相关资料，上传资料越充足，批款效率越高！', 'text')
  }
}
</script>

<style lang="css" scoped>
@import '../../../assets/styles/loanasset.css'
</style>
